import { Ajax } from '@/util/HttpUtil'

// 获取商品分类
export const getGoodsCategory = obj => {
  return Ajax('/goods/catelist', obj)
}

// 添加商品
export const addGoods = formData => {
  return Ajax('/goods/add', formData, 'post')
}

// 获取商品列表
export const getGoodsList = obj => {
  return Ajax('/goods/list', obj)
}

// 删除分类
export const delGoodsInfo = id => {
  return Ajax('/goods/delcate', { id })
}

// 添加商品分类
export const addGoodsCategory = formData => {
  return Ajax('/goods/addcate', formData, 'post')
}

// 获取分类列表

export const getGoodsCategoryList = formData => {
  return Ajax('/goods/catelist', formData)
}

// 删除商品
export const delGoods = id => {
  return Ajax('/goods/del', { id })
}

// 修改商品分类

export const updateGoodsInfo = cate => {
  return Ajax('/goods/editcate', cate, 'post')
}

// 修改商品
export const updateGoods = goods => {
  return Ajax('/goods/edit', goods, 'post')
}
